﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Uber.HabboHotel.Items
{
    class Item
    {
        private uint Id;

        public int SpriteId;

        public string PublicName;
        public string Name;
        public string Type;

        public int Width;
        public int Length;
        public double Height;

        public bool Stackable;
        public bool Walkable;
        public bool IsSeat;

        public bool AllowRecycle;
        public bool AllowTrade;
        public bool AllowMarketplaceSell;
        public bool AllowGift;
        public bool AllowInventoryStack;

        public string InteractionType;

        public List<int> VendingIds;

        public int Modes;

        public uint ItemId
        {
            get
            {
                return Id;
            }
        }

        public Item(uint mId, int mSprite, string mPublicName, string mName, string mType, int mWidth, int mLength, double mHeight, 
            bool mStackable, bool mWalkable, bool mIsSeat, bool mAllowRecycle, bool mAllowTrade, bool mAllowMarketplaceSell, 
            bool mAllowGift, bool mAllowInventoryStack, string mInteractionType, int mModes, string mVendingIds)
        {
            this.Id = mId;
            this.SpriteId = mSprite;
            this.PublicName = mPublicName;
            this.Name = mName;
            this.Type = mType;
            this.Width = mWidth;
            this.Length = mLength;
            this.Height = mHeight;
            this.Stackable = mStackable;
            this.Walkable = mWalkable;
            this.IsSeat = mIsSeat;
            this.AllowRecycle = mAllowRecycle;
            this.AllowTrade = mAllowTrade;
            this.AllowMarketplaceSell = mAllowMarketplaceSell;
            this.AllowGift = mAllowGift;
            this.AllowInventoryStack = mAllowInventoryStack;
            this.InteractionType = mInteractionType;
            this.Modes = mModes;

            this.VendingIds = null;
            this.VendingIds = new List<int>();

            foreach (string VendingId in mVendingIds.Split(','))
            {
                this.VendingIds.Add(int.Parse(VendingId));
            }
        }
    }
}
